//
//  ZTActivityPostSUSViewController.m
//  app001
//
//  Created by xionghao on 15/10/14.
//  Copyright © 2015年 xionghao. All rights reserved.
//

#import "ZTActivityPostSUSViewController.h"
#import "MyZTTableViewController.h"
#import "MYActivityDetailViewController.h"
#import "PostActivityTableViewController.h"
#import "MyActivityListViewController.h"
@interface ZTActivityPostSUSViewController ()

@end

@implementation ZTActivityPostSUSViewController
- (IBAction)buttonclick:(UIButton *)sender {
    switch (sender.tag) {
        case  0:
            for (UIViewController *vc in self.navigationController.viewControllers) {
                if ([vc isKindOfClass:[MyZTTableViewController class]]) {
                    [self.navigationController popToViewController:vc animated:YES];
                }
            }
            
            
            break;
         case 1:
        {
            [self removepostAndDetail];
            MYActivityDetailViewController *vc=[[MYActivityDetailViewController alloc]init];
            vc.isActiviy=self.isActiviy;
            vc.isFromdown=YES;
            vc.ID=self.ID;
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        case 2:
        {
            [self removepostAndDetail];
            for (UIViewController *VC in self.navigationController.viewControllers) {
                if ([VC isKindOfClass:[MyActivityListViewController class]]) {
                    [self.navigationController popToViewController:VC animated:YES];
                    return;
                }
            }
            
            MyActivityListViewController *VC=[[MyActivityListViewController alloc]init];
            VC.isGet=!self.isActiviy;
            [self.navigationController pushViewController:VC animated:YES];
            
        }
            break;
        case 3:
        {
            [self removepostAndDetail];
            PostActivityTableViewController *vc=[PostActivityTableViewController viewcontroller];
            vc.isActivtiy=self.isActiviy;
            [self.navigationController pushViewController:vc animated:YES];
            
        }
            break;
        default:
            break;
    }
    
}
-(UIStatusBarStyle)preferredStatusBarStyle{
    return UIStatusBarStyleLightContent;
}
-(void)removepostAndDetail{
    NSMutableArray *marray=[NSMutableArray arrayWithArray:self.navigationController.viewControllers];
    for (UIViewController *vc in self.navigationController.viewControllers) {
        if ([vc isKindOfClass:[MYActivityDetailViewController class]]||[vc isKindOfClass:[PostActivityTableViewController class]]) {
            [marray removeObject:vc];
        }
    }
    self.navigationController.viewControllers=marray;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title=@"完成";
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
